package com.yunfeisoft.business.model;

import com.yunfeisoft.base.model.WorkflowInstance;
import com.yunfeisoft.common.base.BaseModel;
import com.yunfeisoft.common.sql.record.TransientField;
import com.yunfeisoft.common.utils.DateUtils;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * ClassName: CarApproval
 * Description: 用车审批表
 *
 * @Author: Jackie liu
 * Date: 2020-05-14
 */
@Entity
@Table(name = "TT_CAR_APPROVAL")
public class CarApproval extends BaseModel implements Serializable {

    /**
     * Field serialVersionUID: 序列号
     */
    private static final long serialVersionUID = 1L;

    /**
     * 流程定义id
     */
    @Column
    private String workflowDefineId;

    /**
     * 审批部门
     */
    @Column
    private String dept;

    /**
     * 目的地
     */
    @Column
    private String destination;

    /**
     * 乘车人
     */
    @Column
    private String passengers;

    /**
     * 出发时间
     */
    @Column
    private Date beginDate;

    /**
     * 预计返回时间
     */
    @Column
    private Date endDate;

    /**
     * 用车事由
     */
    @Column
    private String reason;

    /**
     * 备注
     */
    @Column
    private String remark;

    @TransientField
    private Integer validStatus;
    @TransientField
    private String createName;
    //下一节点处理人
    private String nextStepUserId;

    public String getBeginDateStr() {
        if (beginDate != null) {
            return DateUtils.dateToString(beginDate);
        }
        return null;
    }

    public String getEndDateStr() {
        if (endDate != null) {
            return DateUtils.dateToString(endDate);
        }
        return null;
    }

    public String getValidStatusStr() {
        return WorkflowInstance.WorkflowInstanceStatusEnum.valueOf(validStatus);
    }

    public String getWorkflowDefineId() {
        return workflowDefineId;
    }

    public void setWorkflowDefineId(String workflowDefineId) {
        this.workflowDefineId = workflowDefineId;
    }

    public String getDept() {
        return dept;
    }

    public void setDept(String dept) {
        this.dept = dept;
    }

    public String getDestination() {
        return destination;
    }

    public void setDestination(String destination) {
        this.destination = destination;
    }

    public String getPassengers() {
        return passengers;
    }

    public void setPassengers(String passengers) {
        this.passengers = passengers;
    }

    public Date getBeginDate() {
        return beginDate;
    }

    public void setBeginDate(Date beginDate) {
        this.beginDate = beginDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getValidStatus() {
        return validStatus;
    }

    public void setValidStatus(Integer validStatus) {
        this.validStatus = validStatus;
    }

    public String getCreateName() {
        return createName;
    }

    public void setCreateName(String createName) {
        this.createName = createName;
    }

    public String getNextStepUserId() {
        return nextStepUserId;
    }

    public void setNextStepUserId(String nextStepUserId) {
        this.nextStepUserId = nextStepUserId;
    }
}